package com.tryon.repository;

import com.tryon.entity.TryonHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TryonHistoryRepository extends JpaRepository<TryonHistory, Long> {
    
    /**
     * 根据用户ID查询试衣历史
     */
    List<TryonHistory> findByUserIdAndIsDeletedOrderByCreatedAtDesc(Long userId, Integer isDeleted);
    
    /**
     * 根据用户ID和收藏状态查询
     */
    List<TryonHistory> findByUserIdAndIsFavoriteAndIsDeletedOrderByCreatedAtDesc(
        Long userId, Integer isFavorite, Integer isDeleted);
}

